Skip to content

add Manning's n calibration and SRC comparison plot scripts#4

Open
ahaider006 wants to merge 4 commits into
sdmlua:mainfrom
henaogo:ali
Open

add Manning's n calibration and SRC comparison plot scripts#4
ahaider006 wants to merge 4 commits into
sdmlua:mainfrom
henaogo:ali

Conversation

@ahaider006

Copy link
Copy Markdown

calibrate_n_recurrence.py: back-calculates piecewise n at 6 recurrence- interval zones (2/5/10/25/50/50+yr) using NWM recurrence flows and USGS rating curves. Calibrates only branches with a direct 1:1 USGS gauge mapping (non-trunk, RC data available); ungauged branches are left unchanged for future ML regionalization.

plot_src_calibration.py: publication-ready comparison plots showing original SRC vs calibrated SRC vs USGS RC, with piecewise Manning's n as a step function on the secondary top axis.

ahaider006 and others added 2 commits June 30, 2026 10:57
calibrate_n_recurrence.py: back-calculates piecewise n at 6 recurrence-
interval zones (2/5/10/25/50/50+yr) using NWM recurrence flows and USGS
rating curves. Calibrates only branches with a direct 1:1 USGS gauge
mapping (non-trunk, RC data available); ungauged branches are left
unchanged for future ML regionalization.

plot_src_calibration.py: publication-ready comparison plots showing
original SRC vs calibrated SRC vs USGS RC, with piecewise Manning's n
as a step function on the secondary top axis.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Scripts renamed/added with s00-s08 prefix to reflect pipeline order:
  s00  study boundary definition
  s01  DEM download (3DEP)
  s02  Stage 1 - input data / hydrofabric (single HUC + all HUCs)
  s03  Stage 2 - HAND preprocessing (single HUC + all HUCs)
  s04  USGS gage crosswalk (custom)
  s05  Manning's n calibration + revert utility (custom)
  s06  Stage 3 - streamflow (single HUC + all HUCs)
  s07  Stage 4 - SRC calibration (single HUC + all HUCs)
  s08  Stage 5 - FIM generation (single HUC + all HUCs)

Plot scripts added with plot_ prefix (plot_srcs, plot_src_calibration_inset,
plot_workflow_chart). open_parquet.py excluded (debug snippet only).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@supathdhitalGEO supathdhitalGEO added the enhancement New feature or request label Jul 2, 2026
@supathdhitalGEO supathdhitalGEO self-assigned this Jul 2, 2026
@supathdhitalGEO

Copy link
Copy Markdown
Member

Thank you @ahaider006 for this. I will see how I can integrate it as a generic functionality! I will keep you posted.

ahaider006 and others added 2 commits July 2, 2026 16:45
…semble plot scripts

- Add root .gitignore (excludes cache, __pycache__, data files, egg-info)
- Add s04 USGS gauge crosswalk, s05 Manning n calibration scripts
- Add plot_calibration_analysis.py (11-plot calibration diagnostics suite)
- Add plot_src_ensemble.py (clean SRC ensemble plots, no percentile bands)
- Add plot_calibration_slides.py, open_parquet.py utility scripts
- Update s01-s03, s06-s08 pipeline scripts with sequential numbering
- Add docs/study_boundary geopackage

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…he team

Replaces the monolithic v2 calibration script with s05_ncalib_core.py plus
four interchangeable starting-point methods (s05a-d) and two evaluation
scripts (s05e/s05f) that justify choosing method B3 with the incremental
n-application scheme over the alternatives. Fixes a real bug where the
whole-section n column was back-derived from the applied curve instead of
being independently calibrated, so it silently disagreed with the
diagnostics CSV; both n definitions now come from the same source and the
hydroTable carries a genuine second (whole-section) curve for comparison.

Adds s03b_fix_nonmonotonic_srcs.py (monotonicity is now enforced right
after Stage 2, matching how OWP treats it), plot_v2_diagnostics.py, and
export_rc_panels_and_videos.py for consolidated per-gauge RC panels and
slideshow videos.

Reorganizes scripts/ so the team can find the active pipeline at a glance:
15 superseded single-HUC/prototype/old-plotting scripts move to
scripts/legacy/ (via git mv, history preserved), and two new READMEs index
the active set and explain what superseded what.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants